home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
mystic_training.swf
/
scripts
/
__Packages
/
ObjBKG.as
next >
Wrap
Text File
|
2006-11-13
|
2KB
|
65 lines
class ObjBKG extends MovieClip
{
function ObjBKG(P_mcRef, P_nSpeedMax)
{
super();
this._sType = "Background";
this._nSpeed = 0;
this._nSpeedMax = P_nSpeedMax;
this._nDirection = -1;
this._nAccel = 0.2;
this._bStop = false;
this._nLSMappingDistanceToDo = 0;
this._nLSMappingDistanceDone = 0;
_global.C.fAddActiveElement(this);
this.mcRef = P_mcRef;
}
function fDoAction()
{
this.fCheckMappingDistance();
if(this._bStop == false)
{
this.fMoveTerrain(this._nAccel,this._nDirection);
}
}
function fCheckMappingDistance()
{
if(this._nLSMappingDistanceDone >= this._nLSMappingDistanceToDo)
{
_global.C.fGetLSMapped();
this._nLSMappingDistanceToDo += _global.C._nLSMappingPixelRange;
}
}
function fMoveTerrain(l_accel, l_direction)
{
this._nDirection = l_direction;
this._nAccel = l_accel;
if(this._nSpeed < this._nSpeedMax - this._nAccel)
{
this._nSpeed += this._nAccel;
}
else
{
this._nSpeed = this._nSpeedMax;
}
this.mcRef._x += this._nSpeed * this._nDirection;
this._nLSMappingDistanceDone += this._nSpeed;
if(_global.C.G_CurrentGame == "Blue")
{
if(_global.C.PowerRanger._bStack == false)
{
_global.C.PowerRanger.mMc._x -= this._nSpeed * this._nDirection;
}
}
else
{
_global.C.PowerRanger.mMc._x -= this._nSpeed * this._nDirection;
}
_global.C._parent.mcMain.mcInterface._x -= this._nSpeed * this._nDirection;
this.mcRef.mcGuideZero._x -= this._nSpeed * this._nDirection;
this.mcRef.mcBackground._x -= this._nSpeed * this._nDirection;
_global.C.PowerRanger.mMcHit._x -= this._nSpeed * this._nDirection;
_global.C._parent.mcMain.mcInstructions._x -= this._nSpeed * this._nDirection;
}
}